///@file ComplexMatrix.cpp
///@brief Implementation of the class representing a complex matrix
///@author Arnaud Duval
///@version 0.0
///@date 2010/01/18


#include "ComplexMatrix.h"

///@brief Default constructor
ComplexMatrix::ComplexMatrix()
{

}

///@brief Constructor giving the size
///@param nrow number of rows
///@param ncol number of columns
ComplexMatrix::ComplexMatrix(unsigned int nrow, unsigned int ncol)
{
	real = Matrix(nrow, ncol);
	imaginary = Matrix(nrow, ncol);
}

///@brief Destructor
ComplexMatrix::~ComplexMatrix()
{

}

///@brief Return adjoint matrix
ComplexMatrix ComplexMatrix::Adjoint()
{
	ComplexMatrix res;
	res.real = real.Transpose();
	res.imaginary = -1.*imaginary.Transpose();
	return res;
}

///@brief Return transposed matrix
ComplexMatrix ComplexMatrix::Transpose()
{
	ComplexMatrix res;
	res.real = real.Transpose();
	res.imaginary = imaginary.Transpose();
	return res;
}

///@brief Return conjugate matrix
ComplexMatrix ComplexMatrix::Conjugate()
{
	ComplexMatrix res;
	res.real = real;
	res.imaginary = -1.*imaginary;
	return res;
}

///@brief Overload of () operator
///@param row index of row
///@param col index of column
Complex ComplexMatrix::operator()(unsigned int row, unsigned int col)
{
	Complex res(real(row, col), imaginary(row, col));
	return res;
}